package com.lanou3g.loginandregister;

import java.util.ArrayList;
import java.util.Scanner;

/**
 * Created by dllo on 18/4/9.
 */
public class Main {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        Welcome welcome = new Welcome();
        User user = new User();
        Util util = new Util();
        ArrayList<User> userArrayList = new ArrayList<>();


        while (true) {

            welcome.show();
            int num = scanner.nextInt();
            switch (num) {
                case 1: //登录
                    boolean loginSuccess = util.login(userArrayList);
                    if (loginSuccess) {
                        System.out.println("欢迎登陆");
                        return;
                    } else {
                        System.out.println("用户名/密码错误");

                    }
                    break;
                case 2://注册
                    userArrayList = util.register();
                    break;
                default:
                    System.out.println("只能输入1或2");

            }


        }
    }
}

